<!-- loop through all of the doc doc_parts for the doc and render output -->
<% parts.each do |doc_part| %>

  <!-- HTTP method and route (if both specified) -->
  <% if !doc_part[:route].nil? && !doc_part[:http_method].nil? %>
  <div class="route-outer">
    <div id="<%= doc_part[:route].gsub('/', '-').gsub(':', '') %>" class="route-method method-<%=doc_part[:http_method].downcase %>">
      <%= doc_part[:http_method] %>
    </div>
    <div class="route-path"><%= doc_part[:route] %></div>
  </div>
  <% elsif !doc_part[:signature].nil? %>
    <p id="<%= doc_part[:signature].gsub(' ', '-').gsub(',', '').gsub('(', '-').gsub(')', '-')[0..12] %>"><strong><%= doc_part[:signature] %></strong></p>
  <% end %>

  <!-- display all of the docs together for the doc_part -->
  <div class="rain-doc-markdown">
    <%= doc_part[:markdown] %>
  </p>

  <!-- show all of the params in a table -->
  <% if doc_part[:params].length > 0 %>
    <h4>Parameters</h4>
    <table class="u-full-width">
      <thead>
        <tr>
          <th>Name</th>
          <th>Type</th>
          <th>Default</th>
          <th>Description</th>
        </tr>
      </thead>
      <% doc_part[:params].each do |param| %>
        <tr>
          <td><%= param[:name] %></td>
          <td><%= param[:type] %></td>
          <td><%= param[:default].nil? ? 'N/A' : param[:default] %></td>
          <td><%= param[:markdown] %></td>
        </tr>
      <% end %>
    </table>
  <% end %>

  <!-- show all of the headers in a table -->
  <% if doc_part[:headers].length > 0 %>
    <h4>Headers</h4>
    <table class="u-full-width">
      <thead>
        <tr>
          <th>Name</th>
          <th>Description</th>
        </tr>
      </thead>
      <% doc_part[:headers].each do |header| %>
        <tr>
          <td><%= header[:name] %></td>
          <td><%= header[:markdown] %></td>
        </tr>
      <% end %>
    </table>
  <% end %>

  <!-- show all of the responses with examples -->
  <% if doc_part[:responses].length > 0 %>
    <h4>Response Examples</h4>
    <% doc_part[:responses].each do |response| %>
      <p><strong><%= response[:code] %></strong> <%= response[:id].upcase %></p>
      <pre><code><%= response[:text].join("\n") %></code></pre>
    <% end %>
  <% end %>
  <hr />
<% end %>